package com.jingHang.service.impl;

import com.jingHang.common.ServerResponse;
import com.jingHang.dao.OrderInfoMapper;
import com.jingHang.pojo.OrderInfo;
import com.jingHang.service.IOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("orderInfoService1")
public class OrderInfoServiceImpl implements IOrderInfoService {


    @Autowired
    private OrderInfoMapper orderInfoMapper;

    @Override
    public ServerResponse<OrderInfo> selectById(Integer id) {
        OrderInfo orderInfo = orderInfoMapper.selectById(id);
        return ServerResponse.createBySuccess(orderInfo);
    }

    @Override
    public ServerResponse<List<OrderInfo>> getListByUserId(Integer userId) {
        List<OrderInfo> orderInfos = orderInfoMapper.selectByUserId(userId);
        return ServerResponse.createBySuccess(orderInfos);
    }
}
